import urllib.request


keywd = "hello"
url="http://www.baidu.com/s?wd="+keywd
req = urllib.request.Request(url)
data = urllib.request.urlopen(req).read()
file = open("C:/Users/will.mao/Desktop/爬虫demo/Testkeywd.html","wb")
file.write(data)